package com.hy.controller;

import com.hy.appbase.apiresult.ApiDataResult;
import com.hy.appbase.apiresult.ApiResult;
import com.hy.bo.result.GazetteerTreeRetBo;
import com.hy.bo.result.InternalGazetteerTreeRetBo;
import com.hy.service.IInternalGazetteerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api("国内地域名录")
@RestController
@RequestMapping("/internalgazetteer")
public class InternalGazetteerController {

    @Autowired
    private IInternalGazetteerService internalGazetteerService;

    @ApiOperation(value = "findAllInternalGazetteerNode", notes = "获取顶级节点下面说有名录节点")
    @RequestMapping(value = "/findAllInternalGazetteerNode", method = RequestMethod.GET)
    public ApiResult findAllInternalGazetteerNode() {
        List<InternalGazetteerTreeRetBo> internalGazetteerTreeRetBoList = internalGazetteerService.findAllNode();
        return ApiDataResult.SUCCESS(internalGazetteerTreeRetBoList);
    }
}
